<?php

/*
 * This file is the jQuery for showing the attachment information for theatre format.
 * This involves the link opening the theatre, and close button to close the theatre.
 * 
 * Created by: Peter Agno Jr.
 * Date created: October 27, 2011
 */
?>

// Start - jQuery when and attachment link or button was clicked
            jQuery(".shwAttchInfo").live("click",function() {
                // Add transparent box and content box
                jQuery(".body").prepend("<div class='theatreTransparent'> </div>");
                jQuery(".body").prepend("<div class='theatreContentBox' style='width: 78%; margin-left:11%; position: absolute;'> </div>");   
                
                // Get the id of the document
                buttonId = this.id
                tempSubstr = buttonId.split('__');
                documentId = tempSubstr[1];
                
                // Add theatreContent
                jQuery(".theatreContentBox").append("<div class='theatreContent' style='margin-right: 0%; margin-left: 3.5%;'><h1>View Attachment</h1><br/><div class='messageBox successMessage successMessage_fromTheatre' style='display:none;'><div id='successMessages' class='successMessages_fromTheatre'></div></div></div>");
                
                addDocInfo(".theatreContent", documentId, "fromTheatre");      // Add Document Information
                addLogInfo(".theatreContent", documentId, "fromTheatre");      // Add Logs
                addAttchTransac(".theatreContent", documentId, "fromTheatre", "true");      // Add Attachment Transactions
                dispPositions("fromTheatre");   // Add positions inside the theatre of send attachment screenlet
                
                // Add close button
                jQuery("#archiveBtnAttchDiv_fromTheatre").append("<span class='closeBtnSpn'><input type='button' id='closeButton' name='closeButton' value='Close' class='siteGreenButton'></span> &nbsp ");
                
                window.scrollTo(0, 70);
            }); // End - jQuery when and attachment link or button was clicked

            // Start - Close button
            jQuery("#closeButton").live("click",function() {
                jQuery(".theatreTransparent").click();
            }); // End - Close button
            
            // Start - remove theatreTransparent and theatreContentBox
            jQuery(".theatreTransparent").live("click",function() {
                jQuery(".theatreTransparent").remove();
                jQuery(".theatreContentBox").remove();
            }); // End - remove theatreTransparent and theatreContentBox
